<?php
namespace Admin\Controller;
use Think\Controller;
require "./Application/Admin/Common/Common/function.php";
class LoginController extends Controller {


    // public function _before_login(){  


    //    echo '<script>alert("欢迎您使用杭州勒芒后台管理系统")</script>';    


    //  }

     public function login(){
      
      if(empty($_POST)){
         $this->display();
     }else{
       $username = I('post.username');
       $password = I('post.password');
       $map['username&password'] = array($username,$password,'_multi'=>true);
       if(M('user')->where($map)->select()){
        $_SESSION['user']=$username;
        $this->success('登入成功',U('Admin/Index/index'));
      }else{
        $this->error('用户名或密码错误');
      }    
     }
    }









}